West Midlands | ITP SEP | Jonathan Boahene | Sprint 3 |Implement and Rewrite Tests#891
West Midlands | ITP SEP | Jonathan Boahene | Sprint 3 |Implement and Rewrite Tests#891Abayie wants to merge 14 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
You missed updating two Jest test scripts in the rewrite-tests-with-jest subfolder.
| const num = Number(rank); | ||
| if (!isNaN(num) && num >= 2 && num <= 9) { | ||
| return num; | ||
| } |
There was a problem hiding this comment.
In JavaScript, strings that represent valid numeric literals in the language can be safely
converted to equivalent numbers or parsed into a valid integers.
To find out what these strings are, you can ask AI
What kinds of string values would make
Number(rank)evaluate to2in JS?
or
What string values could make the expression
!isNaN(num) && num >= 2 && num <= 9evalute totrue?
Do you want to recognize these string values as valid ranks?
…ithub.com/Abayie/Module-Structuring-and-Testing-Data into coursework/sprint-3-implement-and-rewrite
cjyuan
left a comment
There was a problem hiding this comment.
The tests look good.
Can you also address my comment which I left on Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
|
Yes, I did the research, ChatGPT made understand that are several other numbers that would evaluate to "0-10" which doesn't necessarily have to be exactly "0-10" because JavaScript is VERY permissive. It doesn’t only accept "specific number". It accepts anything that coerces to a specific number. Possible errors could be accidental "2.0", "2e0" bugs, whitespace tricks, coercion abuse |
|
Thank you for your guidance |
Learners, PR Template
Self checklist
Changelist
Implement and rewrite test sprint 3
Questions
No questions